package org.webdb.jdbc;

import java.util.Map;
import java.util.TreeMap;

public class JDBCTreeTableStore implements JDBCTableStore {
    private Map<TableKey, JDBCTable> map = new TreeMap<JDBCTableStore.TableKey, JDBCTable>();

    public JDBCTable retrieve(String schemaName, String tableName) {
        return map.get(new TableKey(schemaName, tableName));
    }

    public void store(JDBCTable table) {
        map.put(new TableKey(table.getSchema(), table.getName()), table);
    }

    public void store(TableKey tableKey, JDBCTable jdbcTable) {
        map.put(tableKey, jdbcTable);
    }

}
